<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>searchArea</title>
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
</head>
<body>
	<input type="text" name="area">
	<table id="list"></table>
	<script type="text/javascript">
		$("input").on("keyup",function(e){
			var key=$(this).val();
			if(key){
				var input=encodeURI(encodeURI(key));
				var uri="http://10.222.29.173:8080/Search/baidu?key="+input;
				$.ajax({
					type:"GET",
					url:uri
				}).done(function(msg){
					$("#list").html("");
					var table=$("#list");
					$.each(JSON.parse(msg),function(index,content){
						var tr=$("<tr></tr>");
						var td=$("<td>"+content.area+"</>");
						tr.appendTo(table);
						td.appendTo(tr);
					});
				});
			}else{
				$("#list").html("");
			}

		});

	</script>
</body>
</html>